package com.pay.ioopos.support.serialport.custom;

import java.math.BigDecimal;

/**
 * 输出指令：取消收款
 * @author moyq5
 * @since 2022/8/2
 * @see SerialPortPayCmd4SubmitDer
 */
public class SerialPortPayCmd2Cancel extends SerialPortPayCmd2Submit {
    private static int serialNo = 0;

    /**
     *
     * @param amount 收款金额，单位：元
     */
    public SerialPortPayCmd2Cancel(BigDecimal amount) {
        super(amount);
    }

    @Override
    protected SerialPortPayCmdType bizType() {
        return SerialPortPayCmdType.PAY_CANCEL;
    }

    @Override
    protected int serialNo() {
        if (serialNo > 0xFFFF) {
            serialNo = 0;
        }
        return serialNo++;
    }

}
